<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>${sysPropertyValue}</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <script type="text/javascript">
        var __ctx = "${ctx}";
        var multipartMaxSize = '${multipartMaxSize}';
    </script>
    <link rel="stylesheet" href="./layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="./systemStatic/style/admin.css">
    <link rel="stylesheet" href="./extends/zTree_v3/css/zTreeStyle/zTreeStyle.css"/>
    <link rel="stylesheet" href="./iconfont/iconfont.css"/>
    <link rel="stylesheet" href="./systemStatic/style/iconfont/iconfont.css">
    <link rel="stylesheet" href="./css/public.css">

</head>
<body class="layui-layout-body">
<div class="im"></div>
<div id="LAY_app">
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header">
            <div class="layui-logo" lay-href="${ctx}/system/indexLayoutManage/view/view">
                <img src="./systemStatic/images/logo/logo1.png" alt="" style="width: 250px">
            </div>

            <!-- 头部区域 -->
            <script type="text/html" template>
                {{# if(layui.setter.themetype === '3'||layui.setter.themetype === '4'){ }}
                <div id="ccp-topNavStyle" style="position:absolute;left:0px;">
                    <ul class="topNavigation">
                    </ul>
                </div>
                {{# } }}
            </script>
            <ul class="layui-nav layui-layout-left">

                <!--<li class="layui-nav-item layui-this layui-hide-xs layui-hide-sm layui-show-md-inline-block">
                  <a lay-href="" title="">
                    控制台
                  </a>
                </li>-->
                <!-- <li class="layui-nav-item layui-hide-xs" lay-unselect>
                  <a href="http://www.layui.com/admin/" target="_blank" title="前台">
                    <i class="layui-icon layui-icon-website"></i>
                  </a>
                </li>
                <li class="layui-nav-item" lay-unselect>
                  <a href="javascript:;" layadmin-event="refresh" title="刷新">
                    <i class="layui-icon layui-icon-refresh-3"></i>
                  </a>
                </li>
                <li class="layui-nav-item layui-hide-xs" lay-unselect>
                  <input type="text" placeholder="搜索..." autocomplete="off" class="layui-input layui-input-search" layadmin-event="serach" lay-action="template/search/keywords=">
                </li> -->
            </ul>
            <script type="text/html" template>
                {{# if(layui.setter.themetype === '2'){ }}
                <div class="topMenuMoreUl" style="position:absolute;left:300px;overflow: hidden">
                    <ul class="layui-nav layadmin-layout-top-nav" id="lay-top-nav" lay-filter="lay-top-nav"
                        style="height: 56px;">
                    </ul>
                </div>
                {{# } }}
            </script>
            <ul class="layui-nav layui-layout-right colorSwitch" lay-filter="layadmin-layout-right">

                <li class="layui-nav-item " lay-unselect style="width: 30px;">
                    <a href="javascript:;" layadmin-event="leftNav">
                        <i class="layui-icon layui-icon-left"></i>
                    </a>
                </li>
                <li class="layui-nav-item " lay-unselect style="width: 50px;">
                    <a href="javascript:;" layadmin-event="rightNav">
                        <i class="layui-icon layui-icon-right"></i>
                    </a>
                </li>
<!--                <li class="layui-nav-item layui-hide-xs" lay-unselect>-->
<!--                    <a href="javascript:;" layadmin-event="theme">-->
<!--                        <i class="layui-icon layui-icon-theme"></i>-->
<!--                    </a>-->
<!--                </li>-->
<!--                <li class="layui-nav-item layui-hide-xs" lay-unselect>-->
<!--                    <a href="javascript:;" layadmin-event="note">-->
<!--                        <i class="layui-icon layui-icon-note"></i>-->
<!--                    </a>-->
<!--                </li>-->
<!--                <li class="layui-nav-item layui-hide-xs" lay-unselect>-->
<!--                    <a href="javascript:;" layadmin-event="fullscreen">-->
<!--                        <i class="layui-icon layui-icon-screen-full"></i>-->
<!--                    </a>-->
<!--                </li>-->
                <li class="layui-nav-item" lay-unselect>
                    <script type="text/html" template
                            lay-url='{{serverPath.systemPath}}/extend/sysUser/getUserInfo'
                            lay-done="layui.element.render('nav', 'layadmin-layout-right');">
                        <div style="display: inline-block;">
                            <img style="vertical-align: text-bottom;width:32px;height: 32px;border-radius: 50%;display: inline-block;" src="{{serverPath.systemPath +(d.data.picture != null ? d.data.picture : '/systemStatic/style/res/male.jpg')}}" alt="">
                        </div>
                        <a href="javascript:;" style="padding:14px 0 0 8px;color: #fff;display: inline-block">
                            <p style="height: 14px;line-height: 14px;font-size: 12px">欢迎您,{{ d.data.fullName }}</p>
                            <p style="font-size: 12px;height: 14px;line-height: 14px;">密级:{{d.data.privacyLevel}}</p>
                        </a>
<!--                        <dl class="layui-nav-child">-->
<!--                            &lt;!&ndash;            <dd><a lay-href="set/user/info">基本资料</a></dd>&ndash;&gt;-->
<!--                            <dd><a layadmin-event="resPassword" style="text-align: center;">修改密码</a></dd>-->
<!--                            <hr>-->
<!--                            <dd layadmin-event="logout" style="text-align: center;"><a>退出</a></dd>-->
<!--                        </dl>-->
                        <div hidden style="display: none">

                            {{ layui.setter.LStorage.set('orgId',d.data.orgId) }}
                        </div>
                    </script>
                </li>
                <li class="layui-nav-item" lay-unselect>
                    <a id="readMessage" layadmin-event style="width: 3px;height: 45px">
                        <i class="layui-icon layui-icon-notice"></i>
                        <!-- 如果有新消息，则显示小圆点 -->
                        <script type="text/html" template lay-url='${ctx}/qbdms/wQbdMyPushRecord/queryListByData'>
                            <span class="layui-badge-dot" style="display: none;"></span>
                        </script>
                    </a>
                </li>
                <#if showSwitchSelect>
                <li class="layui-nav-item" lay-unselect style="margin-left: 10px;color: #666;width: 160px;">
                    <div class="layui-form switchRole" style="position: relative;top: 17px;">
                        <select lay-filter="switchSelect">
                            <option disabled style="color: #c0c4cc;padding-left: 20px!important;">切换其他身份</option >
                            <#list sysRoleList as item>
                            <option value="${item.roleId}" <#if item.roleId == currRoleId>selected</#if>>${item.roleName}</option>
                            </#list>
                        </select>
                    </div>
                </li>
            </#if>
    <li class="layui-nav-item layui-hide-xs" lay-unselect>
        <a href="javascript:;" layadmin-event="logout">
            <i class="layui-icon iconfont data-iconcommon_out"></i>
        </a>
    </li>
    <li class="layui-nav-item layui-hide-xs" lay-unselect>
        <!--        <a href="javascript:;" layadmin-event="about"><i class="layui-icon layui-icon-more-vertical"></i></a>-->
    </li>
    <!--      <li class="layui-nav-item layui-show-xs-inline-block layui-hide-sm" lay-unselect>-->
    <!--        <a href="javascript:;" layadmin-event="more"><i class="layui-icon layui-icon-more-vertical"></i></a>-->
    <!--      </li>-->
    </ul>
</div>

<!-- 侧边菜单 -->
<div class="layui-side-menubj" >
    <div class="layui-side layui-side-menu">
        <div class="layui-side-scroll" style="overflow-x: auto">
            <ul class="layui-nav layui-nav-tree" lay-shrink="all" id="LAY-system-side-menu"
                lay-filter="layadmin-system-side-menu">
            </ul>
        </div>
    </div>
    <div class="layadmin-flexible" lay-unselect>
        <a href="javascript:;" layadmin-event="flexible" id="layadminFlexible" index="1">
            <i class="layui-icon layui-icon-shrink-right" id="LAY_app_flexible"></i>
        </a>
    </div>
</div>
<!-- 页面标签 -->
<!--<script type="text/html" template>-->
<!--    {{# if(localStorage.getItem('pageTabs') === '1'){ }}-->
    <div class="layadmin-pagetabs" id="LAY_app_tabs">
        <div class="layui-icon layadmin-tabs-control layui-icon-prev" layadmin-event="leftPage"></div>
        <div class="layui-icon layadmin-tabs-control layui-icon-next" layadmin-event="rightPage"></div>
        <div class="layui-icon layadmin-tabs-control layui-icon-down">
            <ul class="layui-nav layadmin-tabs-select" lay-filter="layadmin-pagetabs-nav">
                <li class="layui-nav-item" lay-unselect>
                    <a href="javascript:;"></a>
                    <dl class="layui-nav-child layui-anim-fadein">
                        <dd layadmin-event="refresh"><a href="javascript:;">刷新当前页</a></dd>
                        <dd layadmin-event="closeThisTabs"><a href="javascript:;">关闭当前页</a></dd>
                        <dd layadmin-event="closeOtherTabs"><a href="javascript:;">关闭其它页</a></dd>
                        <dd layadmin-event="closeAllTabs"><a href="javascript:;">关闭全部页</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
        <div class="layui-tab" lay-unauto lay-allowClose="true" lay-filter="layadmin-layout-tabs">
            <ul class="layui-tab-title" id="LAY_app_tabsheader">
                <li lay-id="${ctx}/system/indexLayoutManage/view/view" style="background-color: #fff"><i class="layui-icon iconfont data-iconcommon_home"></i></li>
            </ul>
        </div>
    </div>
<!--    {{# } }}-->
<!--</script>-->
<!-- 主体内容 -->
<div class="layui-body" id="LAY_app_body">
    <div class="layadmin-tabsbody-item layui-show">
        <iframe src="${ctx}/system/indexLayoutManage/view/view" frameborder="0" class="layadmin-iframe"></iframe>
    </div>
</div>

<!-- 辅助元素，一般用于移动设备下遮罩 -->
<div class="layadmin-body-shade" layadmin-event="shade"></div>

</div>
</div>
<script src="./layui/layui.js"></script>
<script src="./extends/jquery.js" type="text/javascript"></script>
<script src="./public/component.js" type="text/javascript"></script>
<script src="./extends/zTree_v3/js/jquery.ztree.all.min.js" type="text/javascript"></script>
<script src="./extends/zTree_v3/js/jquery.ztree.exhide.min.js" type="text/javascript"></script>
<script>
        layui.config({
            base: serverPath.systemPath + staticPath.systemPath //指定 layuiAdmin 项目路径，本地开发用 src，线上用 dist
            , version: '1.2.1'
        }).use(['index','initData','layer', 'element','setter','common','form','admin'], function () {
            var $ = layui.jquery,
                setter = layui.setter,
                layer = layui.layer,
                common= layui.common,
                initData=layui.initData,
                form = layui.form,
            admin = layui.admin;
            //加载im模块页面
            if('${loadIm}') {
                $('.im').load(serverPath.imPath + '/im/view/imIndex');
            }

            $('#layadminFlexible').on('click', function(){
                var that = this;
                if($(this).attr('index')==='1'){
                    $(this).attr('index','2')
                }else{
                    $(this).attr('index','1')
                }
            });
            $('#layadminFlexible').on('mouseenter', function(){
                var that = this;
                if($(this).attr('index')==='1'){
                    layer.tips('点击收起导航', that,{tips:[1,'#2682FF']});
                }else{
                    layer.tips('点击展开导航', that,{tips:[1,'#2682FF']});
                }
            });


            $.ajax({
                url:serverPath.systemPath + setter.sysLinkPath + "sysProperty/getPropertyByAlias",
                type:"GET",
                dataType: 'json',
                contentType: 'application/json',
                success:function (data) {
                    if(data.data){
                        var myVar = setInterval(function() {
                            $.ajax({
                                url: serverPath.systemPath + setter.sysLinkPath + "messageReceiver/needPopupRemind",
                                type: "GET",
                                dataType: 'json',
                                contentType: 'application/json',
                                success:function (data) {
                                    if(data.data > 0){
                                        var html = "<a lay-href='/system/messageReceiver/view/list'>您有新的消息,请注意查收!</a>";
                                        top.layer.open({
                                            type: 1
                                            ,title:"提示信息"
                                            ,offset: 'rb'
                                            ,area:['300px','200px']
                                            ,id: 'layerDemo'
                                            ,content: html
                                            ,btn: []
                                            ,move: false
                                            ,shade: 0
                                            ,yes: function(){
                                                layer.closeAll();
                                            }
                                        });
                                    }
                                },error:function (XMLHttpRequest, textStatus, errorThrown) {
                                    layer.alert("获取数据失败！" + XMLHttpRequest.status);
                                    clearInterval(myVar);
                                }
                            })
                        }, 1000*30);
                    }
                }
            })

            $("#readMessage").on("click",function () {
                $.ajax({
                    url: '${ctx}/qbdms/wQbdMyPushRecord/queryListByData',
                    type: "GET",
                    dataType: 'json',
                    contentType: 'application/json',
                    success:function (data) {
                        var returnData = data.data;
                        /*if(returnData.length > 0){

                        }else{
                            $("#readMessage").find('.layui-badge-dot').hide();
                        }*/
                        var html = "";
                        if(returnData.length > 0){
                            html = "<p class='tit'>关注的消息有更新了</p><ul>";
                            for(var i =0;i<returnData.length;i++){
                                if(i<5){
                                    html += "<li style='overflow:hidden;text-overflow:ellipsis;white-space:nowrap'><i class='iconfont data-iconcommon_edot'></i><a lay-href='${ctx}/qbdms/wQbdMyKnowledge/view/particulars?isPopupRemindData=true&id="+returnData[i].knowledgeId+"' title='["+returnData[i].knowledgeclass+"]"+returnData[i].knowledge+"'>["+returnData[i].knowledgeclass+"]"+returnData[i].knowledge+"<cite style='display: none'>知识详情</cite></a></li>";
                                }else{
                                    html += "<li class='more' style='text-align: right'><a lay-href='${ctx}/qbdms/wQbdMyKnowledge/view/messageList'>更多<cite style='display: none'>我的未读</cite></a></li>";
                                    break;
                                }
                            }
                            html += "</ul>";
                        }else{
                            html = "<div style='margin:35px 0px 0px 75px'><img src='${ctx}/systemStatic/images/no.png'>" +
                                "<div style='padding-left: 56px;'>暂无消息</div></div><ul>";
                            $("#readMessage").find('.layui-badge-dot').hide();
                        }

                        var index=layer.tips(html, $("#readMessage") , {
                            tips: 3
                            ,time: 0
                            ,anim: 5
                            ,offset: 'rb'
                            ,area:['360px','250px']
                            ,fixed: true
                            ,skin: 'layui-box qbdms-tips'
                            ,success: function(layero){
                                var stopmp = function(e){ layui.stope(e); };
                                layero.off('mousedown', stopmp).on('mousedown', stopmp);
                            }
                        });
                        function hide(){
                            layer.close(index);
                        }
                        $(document).off('mousedown', hide).on('mousedown', hide);
                        $(window).off('resize', hide).on('resize', hide);
                        $(document).find('iframe').contents().off('mousedown', hide).on('mousedown', hide);
                        $(document).click(function () {
                            layer.close(index);
                        })

                    },error:function (XMLHttpRequest, textStatus, errorThrown) {
                        layer.alert("获取数据失败！" + XMLHttpRequest.status);
                    }
                })
            })


            var myVar = setInterval(function() {
                $.ajax({
                    url: "${ctx}/qbdms/wQbdMyPushRecord/queryListByData",
                    type: "GET",
                    dataType: 'json',
                    contentType: 'application/json',
                    success:function (data) {
                        var returnData = data.data;
                        if(returnData.length <= 0){
                            $("#readMessage").find('.layui-badge-dot').hide();
                        }else{
                            $("#readMessage").find('.layui-badge-dot').show();
                        }
                    },error:function (XMLHttpRequest, textStatus, errorThrown) {
                        layer.alert("获取数据失败！" + XMLHttpRequest.status);
                        clearInterval(myVar);
                    }
                })
            },1000*30)

//            function
            /*function myStopFunction() { clearInterval(myVar); }*/

            admin.events.timingPopup("",null,300);
            //导航初始化
            initData.menuInit({
                url: serverPath.systemPath + setter.sysLinkPath + 'sysRes/listMenu',
                type: setter.themetype
            });
            layui.element.render();

            if('${showRestPwd}'){
                layer.open({
                    type: 2,
                    area: ['550px', '350px'],
                    title: ['修改密码'],
                    content: serverPath.systemPath + setter.sysLinkPath + 'sysUser/view/resetPwd?msg=${msg}',
                    closeBtn :0,
                    move: false
                });
            }

            //顶部各种导航的位置
            var topWidth=$('.layui-layout-right').width()+12;
            $('#ccp-topNavStyle').css('right',topWidth);
            $('.topMenuMoreUl').css('right',topWidth);
            form.render();
            form.on('select(switchSelect)', function(data){
                var roleId = data.value;
                if(roleId){
                    $.ajax({
                        url: serverPath.systemPath + "/saveCurrentSysAndRole"
                        ,data: {"roleId":roleId}
                        ,type:"post"
                        ,dataType:'json'
                        ,success: function(data){
                            if (common.filterRecord(data)) {
                                window.location.href = serverPath.systemPath + "/index"
                            } else {
                                window.parent.layer.alert(data.msg);
                            }
                        }
                    });
                }
            });
        });
    </script>
<style>
    #layui-layer1{
        left: 1347px;
    }
</style>
</body>
</html>


